<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Book_model extends CI_Model {
    
    function Book_model()
    {
        parent::__construct();
        //$this->CI =& get_instance();
    }
    
    function grid()
    {
        // Build query
        //$this->CI->flexigrid->build_query();
        $this->flexigrid->build_query();

        // Get records
        $return['records'] = $this->db->get('book_accessions');

        // Build count query
        $this->db->select('count(id) as record_count');
        //$this->CI->flexigrid->build_query(FALSE);
        $this->flexigrid->build_query(FALSE);
        $record_count = $this->db->get('book_accessions');
        $row = $record_count->row();

        // Get record count
        $return['record_count'] = $row->record_count;

        return $return;
    }

}

/* End of file book_model.php */
/* Location: ./application/models/book_model.php */